package com.systop.busafter.banner.mapper;

import com.systop.commer.pojo.Banner;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BannerMapper {
    /*
     * 修改banner
     * banner banner
     * return int
     * csh
     *
     * */
    @Update("update banner set banner_name = #{banner_name},banner_image = #{banner_image},banner_state = #{banner_state} where banner_id = #{banner_id}")
    int updatabannerid(Banner banner);


    /*
     * 添加banner
     * banner banner
     * return int
     * csh
     *
     * */
    @Insert("insert into banner(banner_name,banner_image,banner_state) values (#{banner_name},#{banner_image},#{banner_state})")
    int insertbanner(Banner banner);

    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from banner")
    List<Banner> bannerListall();

    /*
     * 用id查看banner
     * banner_id  int
     * list
     * csh
     * */
    @Select("select * from banner where banner_id = #{banner_id}")
    List<Banner> bannerIdlist(int banner_id);

    /*
     * 用id查看banner
     * banner_id  int
     * banner
     * csh
     * */
    @Select("select * from banner where banner_id = #{banner_id}")
    Banner BannerId(int banner_id);

    /*
     * 删除banner
     * banner_id  int
     * return int
     * csh
     * */
    @Delete("delete from banner where banner_id=#{banner_id}")
    int deletebannerId(int banner_id);

}
